import React, { Component } from 'react'
import Message from './Message/Message'
import News from './News/News'
import MyNavLink from '../../components/mynavlink/MyNavLink'
import { Route, Switch, Redirect } from 'react-router-dom'
export default class home extends Component {
  render () {
    return (
      <div>
        <h3>我是 Home 组件的内容</h3>
        <div>
          <ul className='nav nav-tabs'>
            <li>
              <MyNavLink to='/home/news'>News</MyNavLink>
            </li>
            <li>
              <MyNavLink to='/home/message'>Message</MyNavLink>
            </li>
          </ul>
          {/* 注册路由 */}
          <Switch>
            <Route path='/home/news' component={News} />
            <Route path='/home/message' component={Message} />
            <Redirect to='/home/news' />
          </Switch>
        </div>
      </div>
    )
  }
}
